from selenium.webdriver.common.by import By
from time import sleep
from guoqingzuoye1.Base import Base

class Page(Base):

    get_login=(By.XPATH,'/html/body/div[2]/div/div[1]/div/a[1]')
    def get_logg(self):
        self.click(self.get_login)

    send_user=(By.ID,'userName')

    def username(self,username):
        self.send_keys(self.send_user,username)

    send_pwd = (By.ID, 'password')
    def password(self,password):
        self.send_keys(self.send_pwd,password)

    button_login=(By.XPATH,'//*[@id="save"]')
    def login_button(self):
        self.click(self.button_login)

    quedin=(By.XPATH,'//*[@id="bindSub"]')
    def quedd(self):
        self.click(self.quedin)

    def jiuxian_login(self):
        self.open_url('https://www.jiuxian.com/')
        sleep(2)
        self.get_logg()
        sleep(2)
        self.send_zm()
        self.send_mima()
        sleep(7)
        self.login_button()
        sleep(2)
        self.quedd()
        sleep(2)